<%-- 
    Document   : Usuario
    Created on : 23/10/2012, 05:57:32 PM
    Author     : Vasquez
--%>

<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link type="text/css" href="../css/formulario.css" rel="stylesheet" media="screen"/>
        <title>Reportes</title>
    </head>
    <body>
        <f:view>

            <jsp:include page="../TablaSistema/Menu.jsp"/>
            <rich:panel>
                <h:form id="form1">
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" style="font-size:10px; font-family:verdana">
                        <tr>
                            <td width="100%" colspan="10">
                                <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                    <tr>
                                        <td align="center"><h:outputText value="REPORTES GENERALES" style="font-weight: bold;font-size:20;"/></td>
                                        <td align="right">
                                            <a4j:status>
                                                <f:facet name="start">
                                                    <h:graphicImage  value="/Imagenes/actions/loading2.gif"/>
                                                </f:facet>
                                            </a4j:status>
                                            <rich:spacer width="8px"/>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr style="height: 20px;">
                            <td ><hr size="1"></td>
                        </tr>
                        <tr>
                            <td align="center"><h:outputText value="Fecha Inicio: "/>
                                <rich:calendar  id="iFechaIni"  value="#{mbPrestamo.repFec_ini}" datePattern="dd-MM-yyyy" />

                                <h:outputText value="Fecha Fin: "/>
                                <rich:calendar  id="iFechaFin"  value="#{mbPrestamo.repFec_fin}" datePattern="dd-MM-yyyy" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <br/>
                            </td>
                        </tr>
                        <tr style="font-weight: bold;font-size:20px;">
                            <td align="center" style="font-weight: bold;font-size:20px;">
                                <h:selectOneRadio id="TipoReporte" value="#{mbPrestamo.sTipoReporte}" style="font-weight: bold;font-size:20px;">
                                    <f:selectItem itemLabel="Reporte Tipo Prestamo" itemValue="006001" />
                                    <f:selectItem itemLabel="Reporte Tipo Documento" itemValue="006002" />
                                    <f:selectItem itemLabel="Reporte Tipo Lector" itemValue="006003" />
                                </h:selectOneRadio>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <br/>
                            </td>
                        </tr>
                        <tr>
                            <td align="center">
                                <h:graphicImage value="/Imagenes/actions/printer.png" alt="Pdf" title="Pdf">
                                    <a4j:support event="onclick" actionListener="#{mbPrestamo.ImprimirFicha}" oncomplete="javascript:Richfaces.showModalPanel('mp7')" reRender="titulo,reporte"/>
                                </h:graphicImage>
                                
                            </td>
                        </tr>
                    </table>
                </h:form>

            </rich:panel>
            <rich:modalPanel id="mp7" width="700" height="490">
                <f:facet name="header">
                    <h:outputText id="titulo" value="#{mbPrestamo.tituloReporte}" />
                </f:facet>
                <f:facet name="controls">
                    <h:graphicImage value="/Imagenes/actions/stop.png" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp7')" title="Cerrar"/>
                </f:facet>
                <h:form>
                    <table>
                        <tr>
                            <td align="center" valign="middle">
                                <rich:panel>
                                    <a4j:mediaOutput id="reporte" uriAttribute="data" style="width : 650px; height: 420px;" element="object" standby="cargando..." createContent="#{mbPrestamo.cargarReporte}" mimeType="application/pdf" value="#{mbPrestamo.valorRep}"/>
                                </rich:panel>
                            </td>
                        </tr>
                    </table>
                </h:form>

            </rich:modalPanel>

        </f:view>
    </body>
</html>
